/* Toast 容器 */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 350px;
}

/* Toast 基础样式 */
.toast {
    position: relative;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast 头部 */
.toast-header {
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.toast-title {
    font-weight: 600;
    margin-right: auto;
}

.toast-close {
    padding: 0;
    background-color: transparent;
    border: 0;
    margin-left: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast 内容 */
.toast-body {
    padding: 0.5rem 0;
    color: #4b5563;
}

/* Toast 类型 */
.toast-success {
    background-color: #ecfdf5;
    border-color: #059669;
}

.toast-success .toast-header {
    color: #059669;
    border-bottom-color: #059669;
}

.toast-success .toast-body {
    color: #065f46;
}

.toast-error {
    background-color: #fef2f2;
    border-color: #dc2626;
}

.toast-error .toast-header {
    color: #dc2626;
    border-bottom-color: #dc2626;
}

.toast-error .toast-body {
    color: #991b1b;
}

.toast-warning {
    background-color: #fffbeb;
    border-color: #fbbf24;
}

.toast-warning .toast-header {
    color: #d97706;
    border-bottom-color: #fbbf24;
}

.toast-warning .toast-body {
    color: #92400e;
}

.toast-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.toast-info .toast-header {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.toast-info .toast-body {
    color: #1e40af;
}

/* Toast 动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.slide-in {
    animation: slideIn 0.3s ease forwards;
}

.toast.slide-out {
    animation: slideOut 0.3s ease forwards;
}

/* Toast 进度条 */
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.375rem 0.375rem;
}

.toast-progress-bar {
    height: 100%;
    background-color: currentColor;
    border-radius: inherit;
    transition: width linear;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .toast {
        background-color: #1f2937;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
                    0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }

    .toast-header {
        border-bottom-color: #4b5563;
        color: #f3f4f6;
    }

    .toast-close {
        color: #9ca3af;
    }

    .toast-body {
        color: #d1d5db;
    }

    .toast-success {
        background-color: rgba(5, 150, 105, 0.1);
        border-color: #059669;
    }

    .toast-success .toast-header {
        color: #34d399;
    }

    .toast-success .toast-body {
        color: #a7f3d0;
    }

    .toast-error {
        background-color: rgba(220, 38, 38, 0.1);
        border-color: #dc2626;
    }

    .toast-error .toast-header {
        color: #f87171;
    }

    .toast-error .toast-body {
        color: #fca5a5;
    }

    .toast-warning {
        background-color: rgba(251, 191, 36, 0.1);
        border-color: #fbbf24;
    }

    .toast-warning .toast-header {
        color: #fbbf24;
    }

    .toast-warning .toast-body {
        color: #fcd34d;
    }

    .toast-info {
        background-color: rgba(59, 130, 246, 0.1);
        border-color: #3b82f6;
    }

    .toast-info .toast-header {
        color: #60a5fa;
    }

    .toast-info .toast-body {
        color: #93c5fd;
    }

    .toast-progress {
        background-color: rgba(255, 255, 255, 0.1);
    }
} 